var visa_vmts = {
	batch_update : function(){
		var elmt, postdata;
		
		if(confirm('Confirm the data below has been updated?')){
			
			var case_id = [];
			$('table.visavmtsbatch').children('tbody').children('tr').each(function(){
				var row_case_id = $(this).attr('data-caseid');
				var row_batch_id = $(this).attr('data-batchid');
				
				if((row_batch_id > 0) == false) {
					case_id.push(row_case_id);
				}
			});
			
			
			if(case_id.length <= 0) {
				mapUI.jq_message("No application case to be updated.", 10);
				return;
			}
			
			console.log(JSON.stringify(case_id));
			postdata = 'case_arr=' + encodeURIComponent(JSON.stringify(case_id));
			
			var callback = function(json){
	            if(json.status == 'OK'){
	            	mapUI.jq_message("Visa VMTS batch saved successfully.", 10);
	            	window.location.reload();
					
	            } else {
	            	mapUI.jq_message(json.message, 10);
	            }
	        };
			
	        var jq = {
	            'method' : 'POST',
	            'url' : jq_main_url + '/SubmitApp.do?dispatch=visa_vmts_batch',
	            'postdata' : postdata
	        };
			
	        mapUI.jq_call(jq, callback);
		}
	},
};